namespace SymLib;

public class Trie {
    class Node {
        public Dictionary<Char, Node> children;
        public Boolean isWord;
        public Node() {
            children = new Dictionary<Char, Node>();
            isWord = false;
        }
    }
    Node root;
    public Trie() {
        root = new Node();
    }
    public void Insert(String word) {
        Node node = &root;
        foreach(Char c in word) {
            if(!node.children.ContainsKey(c)) {
                node.children.Add(c, new Node()); 
            }
            node = node.children[c];
        } 
    }
    
}
